package org.karelun.ideaboard.edit.ui.cdo.action;

import org.eclipse.emf.cdo.view.CDOView;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.karelun.ideaboard.edit.ui.cdo.ITransactionEditingDomain;

public class CopyAction extends org.eclipse.emf.edit.ui.action.CopyAction {
	
	public CopyAction(ITransactionEditingDomain domain) {
		super(domain);
	}

	public CopyAction() {
		super();
	}

	@Override
	public boolean updateSelection(IStructuredSelection selection) {
		CDOView cdoView = ((ITransactionEditingDomain) getEditingDomain())
				.getCDOView();
		if(cdoView.isClosed()||cdoView.isReadOnly()){
			return false;
		}
		return super.updateSelection(selection);
	}
}
